package com.zxy.base.controller;

import com.zxy.base.dto.Result;
import com.zxy.base.util.ResultUtil;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.*;

@RestControllerAdvice(annotations = RestController.class)
public class GlobalExceptionHandler {


    @ExceptionHandler(Exception.class)
    @ResponseStatus(HttpStatus.INTERNAL_SERVER_ERROR)
    public Result exeptionHandler(Exception e) {
        return new Result(HttpStatus.INTERNAL_SERVER_ERROR.value(),e.getMessage(),e);
    }

}
